<#include "/common/h-ui-base-css.html">
<#include "/common/h-ui-base-js.html">
<table class="table table-border table-bordered table-bg" id="show_files">
    <thead>
		<tr>
			<th>文件名称</th>
			<th>操作</th>
		</tr>
    </thead>
    <tbody>
		<#if all??>
			<#list all as g>
				<tr>
					<th>${g.fileName}</th>
					<#--<td>${g.id}</td>-->
					<td>
						<a href="javascript:;" onclick="del(${g.id})" class="btn btn-danger radius">
							<i class="Hui-iconfont">&#xe6e2;</i> 删除
						</a>

                        <#--<a href="d:\uploadFiles\${g.uuid}\${g.state}\${g.fileName}"  class="btn btn-primary radius"">-->
                            <#--<i class="Hui-iconfont">&#xe600;</i> 查看-->
                        <#--</a>-->

                            <a href="javascript:;" onclick="detail(${g.id})" class="btn btn-primary radius">
							<i class="Hui-iconfont">&#xe600;</i> 下载
						</a>
					</td>
				</tr>
			</#list>
		</#if>
    </tbody>
</table>

<script type="text/javascript">
	function del(value){
        $.ajax({
            type :'post',
            url : '/file-ins-upd-del/'+value,
			data : {deleteFlag:'Y'},
            async :false,
            success :function(){
                var index = parent.layer.getFrameIndex(window.name);
                // var handler = '/project-list/0/1/20';
                // parent.$('#project_table').datagrid('options').url = handler;
                parent.$('#project_table').datagrid('reload');
                parent.layer.close(index);
            }
        });
	}
	function detail(value){
        $.ajax({
            type :'post',
            url : '/file-location/'+value,
            async :false,
            success :function(data){
                var url = "http://"+window.location.host+data;
                window.open(url);
            }
        });

	}
</script>